package Simulation;

import java.util.ArrayList;
import java.util.HashMap;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.me.mynanogame.StaticSprites;

import Simulation.Gem.GemType;

public class Player {
	public HashMap<GemType, Integer> stack;
	public HashMap<GemType, Integer> visibleStack;
	public ArrayList<Gem> playerGems;
	public Sprite portrait;
	public Sprite visiblestash;
	public boolean inNeg;
	
	public Player(int id){
		inNeg = true;
		stack = new HashMap<GemType, Integer>();
		visibleStack = new HashMap<GemType, Integer>();
		playerGems = new ArrayList<Gem>();
		if(id == 0){
			visiblestash = StaticSprites.player1Stack;
		}
		else{
			visiblestash = StaticSprites.visibleStack[id];
		}
		portrait = StaticSprites.protossP;
		portrait.setSize(Gdx.graphics.getWidth()/12f, Gdx.graphics.getHeight()/10f);
	}
	
	public void addGem(GemType type, HashMap<GemType, Integer> hm){
		int value;
		if(hm.get(type) == null){
			value = 0;
		}
		else{
			value = hm.get(type);
		}
		hm.put(type, value+1);
	}
	
	public Sprite getVisibleStash(){
		return visiblestash;
	}
	
	public Sprite getPortrait(){
		return portrait;
	}
	
	public void changeNeg(boolean neg){
		inNeg = neg;
	}
	
	public boolean getNeg(){
		return inNeg;
	}
}
